constraints demo: Update comments
authorMatthias Clasen <mclasen@redhat.com>
Sat, 29 Jun 2019 14:15:42 +0000 (10:15 -0400)
committerEmmanuele Bassi <ebassi@gnome.org>
Sun, 30 Jun 2019 23:10:11 +0000 (00:10 +0100)
demos/gtk-demo/constraints.c

index 806fd407ab67b2e70572f7df16eca023c436e7de..9e2bf3577d7492c4073f1559c3db77a9035e4878 100644 (file)
@@ -44,20 +44,21 @@ simple_grid_class_init (SimpleGridClass *klass)
 
 /* Layout:
  *
- *   +-----------------------------+
- *   | +-----------+ +-----------+ |
- *   | |  Child 1  | |  Child 2  | |
- *   | +-----------+ +-----------+ |
- *   | +-------------------------+ |
- *   | |         Child 3         | |
- *   | +-------------------------+ |
- *   +-----------------------------+
+ *   +-------------------------------------+
+ *   | +-----------++-------++-----------+ |
+ *   | |  Child 1  || Space ||  Child 2  | |
+ *   | +-----------++-------++-----------+ |
+ *   | +---------------------------------+ |
+ *   | |             Child 3             | |
+ *   | +---------------------------------+ |
+ *   +-------------------------------------+
  *
  * Constraints:
  *
  *   super.start = child1.start - 8
  *   child1.width = child2.width
- *   child1.end = child2.start - 12
+ *   child1.end = space.start
+ *   space.end = child2.start
  *   child2.end = super.end - 8
  *   super.start = child3.start - 8
  *   child3.end = super.end - 8
@@ -69,6 +70,12 @@ simple_grid_class_init (SimpleGridClass *klass)
  *   child3.height = child2.height
  *   child3.bottom = super.bottom - 8
  *
+ * To add some flexibility, we make the space
+ * stretchable:
+ *
+ *   space.width >= 10
+ *   space.width = 100
+ *   space.width <= 200
  */
 static void
 build_constraints (SimpleGrid          *self,